The background description provided herein is for the purpose of generally presenting the context of the disclosure. Work of the presently named inventors, to the extent the work is described in this background section, as well as aspects of the description that may not otherwise qualify as prior art at the time of filing, are neither expressly nor impliedly admitted as prior art against the present disclosure.
Generally, content addressable memory (CAM) is used in various applications to provide a comparatively fast exact match searching capability. In an example, a network device, such as a network switch, a router and the like includes a ternary CAM (TCAM) to store criteria for a plurality of switching rules for various functionalities, such as packet parsing, quality of service assignment, security, forwarding, filtering, and the like. In an example, a criterion includes a requirement, such as a range requirement, exact match requirements, and the like, that occupies one or more TCAM entries, and addresses of the TCAM entries point to action codes associated with the criterion. When the network device receives a packet, attributes of the packet are extracted to form a search key. The search key is compared with plural TCAM entries, typically comparison of the search key against the plural TCAM entries is performed in parallel in a single clock cycle, to find a matching entry from among the TCAM entries in a single search operation. The address of the matching entry points to an action code. According to the action code, the network device takes specified actions on the packet.